package bussinessService.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import module.CusLog;
import utils.DateUtil;
import bussinessService.cusLogBussinessService;
import domain.vo.CustomerLogVO;
import domain.vo.queryObject;


public class CusLogBussinessServiceImpl implements cusLogBussinessService{

	/* (非 Javadoc) 
	* <p>Title: deleteT</p> 
	* <p>Description: </p> 
	* @param id
	* @throws SQLException 
	* @see bussinessService.basicbussinessService#deleteT(int) 
	*/ 

	public void deleteT(int id) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#deleteT(java.lang.Object)
	 */
	public void deleteT(CusLog t) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getAll()
	 */
	public List<CustomerLogVO> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getById(java.lang.String)
	 */
	public CusLog getById(String id) throws SQLException {
		// TODO Auto-generated method stub
		return cusLogService.getById(id);
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#merageObject(java.lang.Object)
	 */
	public void merageObject(CusLog t) throws SQLException {
		cusLogService.insertObject(t);
		
	}

	public int countByQueryObject(queryObject queryObject) {
		// TODO Auto-generated method stub
		return 0;
	}

	public List<CustomerLogVO> getObjectByQueryObject(queryObject queryObject) throws SQLException {
		List<CustomerLogVO> vos = new ArrayList<CustomerLogVO>();
		List<CusLog> custLogs = cusLogService.getObjectByQueryObject(queryObject);
		for(CusLog cl : custLogs) {
			CustomerLogVO vo  = new CustomerLogVO();
			vo.setContent(cl.getContent());
			vo.setCreateTime(DateUtil.data2String(cl.getCreateTime()));
			vo.setCus_id(cl.getCus_id());
			vo.setE_name(cl.getE_name());
			vo.setE_sn(cl.getE_sn());
			vos.add(vo);
		}
		return vos;
	}


}
